﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Webadmin_Modules_AboutList_AboutList : bzAdminPageAbout
{
    TextBox txtDesVN = new TextBox();
    TextBox txtDesEN = new TextBox();
    private bzAbout bz = new bzAbout();
    private void loadData()
    {
        this.btnUpdate.Text = this.AdminLang["Edit"].ToString();
        this.AboutKey = bzAbout.AboutKey.ContactAbout;

        this.txtContentVN.Text = this.getContent(bzLang.Language.Vietnamese);
        this.txtContentEN.Text = this.getContent(bzLang.Language.Vietnamese);
    }
    override protected void loadAction()
    {
        this.Navigator = this.AdminLang["MenuContact"].ToString() + this.AdminLang["GeneralArrow"].ToString() + "Thông tin liên hệ";
        if (!IsPostBack)
        {
            this.loadData();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.initSiteLang(bzSiteOption.Group.Administrator, bzSiteOption.None, "About");
    }

    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        if (this.AllowEdit)
        {
            bz.updateRecord(bzAbout.AboutKey.ContactAbout, Server.HtmlEncode(this.txtDesVN.Text), Server.HtmlEncode(this.txtDesEN.Text), Server.HtmlEncode(this.txtContentVN.Text), Server.HtmlEncode(this.txtContentEN.Text));
        }
        else
        {
            Response.Redirect(bzStringClass.AlertPermission);
        }
    }
}
